package com.cx.service.activity.impl;

import java.util.List;

import javax.annotation.Resource;

import org.cx.entity.Page;
import org.cx.entity.PageData;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.cx.dao.impl.ChainJKTDaoSupport;
import com.cx.service.activity.ActivityManager;

@Service("activityService")
public class ActivityService implements ActivityManager {

    @Resource(name = "chainJKTDaoSupport")
    private ChainJKTDaoSupport chainJKTDao;

    /**
     * 查询所有套餐
     *
     * @param page
     * @throws Exception
     */
    @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT,timeout=36000,rollbackFor=Exception.class)
    public PageData selectByPrimaryKey(PageData pd) throws Exception {
    	pd = (PageData) chainJKTDao.findForObject("ActivityMapper.selectByPrimaryKey", pd);
    	
        return pd;
    }
    
    /**
     * 查询所有套餐
     *
     * @param page
     * @throws Exception
     */
    @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT,timeout=36000,rollbackFor=Exception.class)
    public List<PageData> selectAllList(Page page) throws Exception {
    	List<PageData> list = (List<PageData>) chainJKTDao.findForList("ActivityMapper.selectByPrimaryKeypage", page);
    	
        return list;
    }

	@Override
	public List<PageData> selectOngoingActPage(Page page) throws Exception {
		List<PageData> list = (List<PageData>) chainJKTDao.findForList("ActivityMapper.selectOngoingActPage", page);
		return list;
	}




}
